package com.ke.controller;

import com.ke.pojo.BaseResp;
import com.ke.service.OrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author bochen
 */
@RestController
@RequestMapping("/order")
@CrossOrigin(allowCredentials = "true")
public class OrderController {
    @Autowired
    OrderItemService orderItemService;
    @RequestMapping("/findAll")
    public BaseResp findAll(HttpServletRequest request){
        System.out.println("sss");
        Integer uid=new Integer((String)request.getAttribute("id"));
        return orderItemService.findAll(uid);
    }
    @RequestMapping("/orderMsg/{uuid}")
    public  BaseResp orderMsg(@PathVariable("uuid")String uuid){
        System.out.println(uuid);
        return orderItemService.orderMsg(uuid);
    }
}
